<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<jsp:include page="common.jsp" flush="true"/>
<!doctype html>
<html>
<head>
    <title>登录</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <style>
        .form-wrapper {
            width: 100%;
            height: 200px;
        }

        .form-wrapper div {
            width: 200px;
            height: 20px;
            margin: 100px auto;
        }

        button {
            width: 100%;
        }

        #message-wrapper {
            text-align: center;
        }
    </style>

</head>
<body>
<div id="message-wrapper" class="alert alert-danger" role="alert" hidden="hidden">
    <span id="message">${message}</span>
</div>
<div class="form-wrapper">
    <div>
        <form method="post" action="<%=request.getContextPath()%>/login">
            <div class="form-group">
                <label for="exampleInputUsername1">用户名</label>
                <input name="username" type="text" value="admin" class="form-control" id="exampleInputUsername1">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">密码</label>
                <input name="password" type="password" value="admin" class="form-control" id="exampleInputPassword1">
            </div>
            <button type="submit" class="btn btn-secondary">登录</button>
        </form>
    </div>
</div>
<script>
    var message = document.getElementById("message").innerText;
    var messageWrapper = document.getElementById("message-wrapper");
    if (message != "") {
        messageWrapper.hidden = "";
    }
</script>
</body>
</html>
